[dynamic control] Add policy config model classes (record-style structure)#2736
Merged
jaydeluca merged 1 commit intoopen-telemetry:mainfrom Apr 2, 2026
Merged
[dynamic control] Add policy config model classes (record-style structure)#2736jaydeluca merged 1 commit intoopen-telemetry:mainfrom
jaydeluca merged 1 commit intoopen-telemetry:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds immutable configuration model classes under dynamic-control to represent initial policy source setup (sources + per-source key→policy mappings). This supports upcoming parsing/initialization work for the dynamic Telemetry Policy pipeline.
Changes:
- Introduce
PolicyInitConfigas a top-level container for configured policy sources. - Introduce
PolicySourceConfigfor per-source configuration (kind/format/location + mappings) with defensive copies and null-element checks. - Introduce
PolicySourceMappingConfigfor individual source-key to policy-type mappings with value semantics.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInitConfig.java | Adds immutable top-level init config holding a list of PolicySourceConfig. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicySourceConfig.java | Adds immutable per-source config (kind/format/location + mappings) with defensive list handling and equals/hashCode. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicySourceMappingConfig.java | Adds immutable mapping element (sourceKey → policyType) with equals/hashCode. |
LikeTheSalad
approved these changes
Apr 2, 2026
jaydeluca
approved these changes
Apr 2, 2026
Merged
via the queue into
open-telemetry:main
with commit Apr 2, 2026
42fea9d
24 of 25 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR adds three immutable, record-type model classes for config initialization
Notes
This would support initialization of the Policy pipeline for examples like the following json or yaml
Existing Issue(s):
#2546
Testing:
Not needed yet these are just record classes
Documentation:
not needed yet, will be added when specific format parsing is added (eg the above json and/or yaml examples)
Outstanding items:
The functionality to parse json and/or yaml files and create the policy pipeline based on that. Note that the yaml example is exactly what could go into declarative config under a policy pipeline node, so this would naturally migrate to declarative config when it the policy structure is stable and accepted